/*function isRender(p){
	alter(p.title +"被渲染了");
}*/
Ext.onReady(function() {
	var i=0;
	var tabpanel = new Ext.TabPanel({
		activeTab:0,
		differredRender:false,
		tabPosition:"bottom",
		enableTabScroll:true,
		bbar:[{text:"添加选项",handler:function(){
			var id="tab"+i;
			tabpanel.add({id:id,title:"子面板"+i++,closable:true});
		}},{text:"删除选项",handler:function(){
			var tab= tabpanel.getActiveTab();
			tabpanel.remove(tab);
		}}],
		items : [ {
			title : "面板1",
			html:"选项1",
			
			//listeners:{render:isRender}
		}, {
			title : "面板2",
			autoLoad:"layout.html"
		},{
			title : "面板3",
			autoLoad:"layout.html",
			closable :true
		}  ]
	});

	new Ext.Viewport({
		items : tabpanel,
		layout:"fit"
	});
});